<% int j = 1; %>
<modalbox:modalIncludes />
<div id="listaDeGuias" class="dialog">
	<h3 class="subtitulo"><g:message code="Guias de Tr&aacute;fego" /></h3>
	<br />
	<table cellpadding="2" cellspacing="1" class="tabelaAzul">
		<tbody>
			<g:if test="${listaGuiasDeTrafego.size == 0}">
				<tr>
					<td ><g:message code="Nenhuma guia de tr&aacute;fego cadastrada"  /></td>
				
				</tr>
			</g:if>
			<g:else>
			
				<g:if test="${listaGuiasDeTrafego.size >= 2}">
					<tr>
						<th class="cabecalhoTabela"><g:message code="N&uacute;mero da Guia" /></th>
						<th class="cabecalhoTabela"><g:message code="N&uacute;mero da Guia" /></th>
					</tr>
					
					<g:each in="${listaGuiasDeTrafego}" status="i" var="guiaAtual">
						<g:if test="${i % 2 == 0}">
							<tr>
						</g:if>
							<g:if test="${j == 1}">
								<td>
								<% j = 0; %>
							</g:if>
							<g:else>
								<td class="linhaAzulClara">
								<% j = 1; %>
							</g:else>
								<modalbox:createLink 
									action="exibirGuia" id="${guiaAtual.id}"
									title="Guia de Tr&aacute;fego" width="400">
			        				${fieldValue(bean: guiaAtual, field: "numeroDaGuia")}
			    				</modalbox:createLink>
							</td>
						<g:if test="${ i % 2 != 0}">
							<% j++; %>
							</tr>
						</g:if>
					
					</g:each>	
				
				</g:if>
				<g:else>
					<tr>
						<th class="cabecalhoTabela"><g:message code="N&uacute;mero da Guia" /></th>
					</tr>
					<g:each in="${listaGuiasDeTrafego}" status="i" var="guiaAtual">
						<tr >
					
						<td>
							<modalbox:createLink 
								action="exibirGuia" id="${guiaAtual.id}" 
								title="Guia de Tr&aacute;fego" width="400">
		        				${fieldValue(bean: guiaAtual, field: "numeroDaGuia")}
		    				</modalbox:createLink>
						</td>
						</tr>
					</g:each>	
				</g:else>
			</g:else>
		</tbody>
	</table>
</div>